﻿using System;
using System.Data;
using System.Data.SQLite;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

public partial class ContractList : CWSPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ListBind();
        }
    }

    private void ListBind()
    {
        string sqlstr = @"SELECT CID,T2.DataName AS Region,StationName,ContractNo,STRFTIME('%Y.%m.%d',BeginDate) BeginDate,STRFTIME('%Y.%m.%d',EndDate) EndDate,Status
                        FROM CW_CONTRACT_T T1
                        LEFT JOIN CW_PUBDATA_T T2
                          ON T1.Region = T2.DataCode
                         AND T2.DataType = 'Region'
                        WHERE STATUS <> '删除' ORDER BY OpeDate DESC";
        DataSet ds = SQLiteHelper.ExecuteDataset(sqlstr, null);
        CList.DataSource = ds;
        CList.DataBind();
    }
}
